﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;

namespace Magicodes.WeChat.EntityFrameworkCore
{
    public class DbContextFactory : IDbContextFactory<WeChatDbContext>
    {
        public WeChatDbContext Create(DbContextFactoryOptions options)
        {
            var builder = new DbContextOptionsBuilder<WeChatDbContext>();
            builder.UseSqlServer("Server=localhost; Database=LearnDrive; Trusted_Connection=True;");
            return new WeChatDbContext(builder.Options);
        }
    }
}
